package com.kanshu.ksgb.fastread.doudou.module.personal.adapter

import android.content.Context
import com.dl7.recycler.adapter.BaseQuickAdapter
import com.dl7.recycler.adapter.BaseViewHolder
import com.kanshu.ksgb.fastread.doudou.R
import com.kanshu.ksgb.fastread.doudou.common.util.Utils
import com.kanshu.ksgb.fastread.doudou.module.personal.bean.UserBean

/**
 * Title:
 * Description:
 * Copyright: Copyright(c)2018
 * Company: 看书网
 * CreateTime: 2018/4/19 16:25
 *
 * @author EvanHe
 * @version 1.0
 */
class MyPrenticesAdapter(val context: Context, val list: MutableList<UserBean>) : BaseQuickAdapter<UserBean>(context, list) {


    override fun convert(holder: BaseViewHolder?, item: UserBean?, position: Int) {
        holder?.apply {
            setText(R.id.nick_name, item?.nickname)
            val rmb = (item?.total_rmb?.toInt() ?: 0) / 100
            setText(R.id.money, "${rmb}元")
            setText(R.id.time, Utils.timeStampToDate(item?.reg_time_u, "yyyy.MM.dd"))
        }
    }

    override fun attachLayoutRes() = R.layout.item_apprentice_layout

}
